package cn.zjweu.controller;

import cn.zjweu.service.CommentService;
import cn.zjweu.utils.ResultUtils;
import cn.zjweu.utils.ResultVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "Comment测试接口")
@RestController
@CrossOrigin
@RequestMapping("/api/v1/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @GetMapping("/getAllComments")
    public ResultVo getAllComments(@RequestParam("menuId") Long menuId, @RequestParam("pageNum") Integer pageNum
            , @RequestParam("pageSize") Integer pageSize) {

        return ResultUtils.success("获取成功", 200, commentService.commentList("0", menuId, pageNum, pageSize)) ;
    }

}
